package org.dromara.common.translation.core.impl;

import lombok.AllArgsConstructor;
import org.dromara.common.core.service.JsExampleService;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;

/**
 * OSS翻译实现
 *
 * @author Lion Li
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.EXAMPLE_id_TO_NAME)
public class ExampleTranslationImpl implements TranslationInterface<String> {

    private final JsExampleService jsExampleService;

    @Override
    public String translation(Object key, String other) {
        if (key instanceof String ids) {
            return jsExampleService.selectNameByIds(ids);
        }
        return null;
    }
}
